home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 5 Developer's Kit / vb5 dev kit.iso / dev / mailx6 / _setup.2 / Group4 / OCXSEFIL.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-07-14  |  5.9 KB  |  197 lines

  1. VERSION 4.00
  2. Begin VB.Form SimpleForm 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Send Message with Attachment FROM Code"
  5.    ClientHeight    =   3705
  6.    ClientLeft      =   1230
  7.    ClientTop       =   1635
  8.    ClientWidth     =   6390
  9.    Height          =   4080
  10.    Left            =   1185
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   3705
  15.    ScaleWidth      =   6390
  16.    ShowInTaskbar   =   0   'False
  17.    Top             =   1305
  18.    Width           =   6480
  19.    Begin VB.TextBox szFileName 
  20.       Height          =   375
  21.       Left            =   1920
  22.       TabIndex        =   8
  23.       Top             =   2040
  24.       Width           =   4095
  25.    End
  26.    Begin VB.CommandButton Command1 
  27.       Caption         =   "Send Message without UI Interface"
  28.       Height          =   495
  29.       Left            =   240
  30.       TabIndex        =   9
  31.       Top             =   2640
  32.       Width           =   5655
  33.    End
  34.    Begin VB.TextBox szNoteText 
  35.       Height          =   375
  36.       Left            =   1920
  37.       TabIndex        =   7
  38.       Top             =   1560
  39.       Width           =   4095
  40.    End
  41.    Begin VB.TextBox szSubject 
  42.       Height          =   375
  43.       Left            =   1920
  44.       TabIndex        =   6
  45.       Top             =   1080
  46.       Width           =   4095
  47.    End
  48.    Begin VB.TextBox szAddress 
  49.       Height          =   375
  50.       Left            =   1920
  51.       TabIndex        =   3
  52.       Top             =   600
  53.       Width           =   4095
  54.    End
  55.    Begin VB.CommandButton Command2 
  56.       Caption         =   "Login cc:Mail"
  57.       Height          =   375
  58.       Left            =   120
  59.       TabIndex        =   0
  60.       Top             =   120
  61.       Width           =   1335
  62.    End
  63.    Begin Mailx16Lib.MForm MForm1 
  64.       Left            =   2160
  65.       Top             =   3270
  66.       _version        =   65542
  67.       _extentx        =   3651
  68.       _extenty        =   500
  69.       _stockprops     =   0
  70.       mxformname      =   "FormTag1"
  71.    End
  72.    Begin Mailx16Lib.MSess MSess1 
  73.       Left            =   360
  74.       Top             =   3120
  75.       _version        =   65542
  76.       _extentx        =   900
  77.       _extenty        =   900
  78.       _stockprops     =   0
  79.       mail_type       =   2
  80.    End
  81.    Begin Mailx16Lib.MMsg MMsg1 
  82.       Left            =   1365
  83.       Top             =   3120
  84.       _version        =   65542
  85.       _extentx        =   900
  86.       _extenty        =   900
  87.       _stockprops     =   0
  88.       markasread      =   0   'False
  89.       displaysenddialog=   0   'False
  90.       bindstring      =   "MSess1"
  91.       fastfetch       =   -1  'True
  92.    End
  93.    Begin Mailx16Lib.MReci MReci1 
  94.       Left            =   5400
  95.       Top             =   3120
  96.       _version        =   65542
  97.       _extentx        =   900
  98.       _extenty        =   900
  99.       _stockprops     =   0
  100.       bindstring      =   "MMsg1"
  101.    End
  102.    Begin Mailx16Lib.MFile MFile1 
  103.       Left            =   4560
  104.       Top             =   3120
  105.       _version        =   65542
  106.       _extentx        =   900
  107.       _extenty        =   900
  108.       _stockprops     =   0
  109.       displaydialog   =   0   'False
  110.       bindstring      =   "MMsg1"
  111.    End
  112.    Begin VB.Label Label5 
  113.       Caption         =   $"OCXSEFIL.frx":0000
  114.       Height          =   375
  115.       Left            =   120
  116.       TabIndex        =   11
  117.       Top             =   3240
  118.       Width           =   6255
  119.    End
  120.    Begin VB.Label szFile 
  121.       Caption         =   "File Name:"
  122.       Height          =   255
  123.       Left            =   240
  124.       TabIndex        =   10
  125.       Top             =   2160
  126.       Width           =   1455
  127.    End
  128.    Begin VB.Label Label4 
  129.       Caption         =   "Note Text"
  130.       Height          =   375
  131.       Left            =   240
  132.       TabIndex        =   5
  133.       Top             =   1560
  134.       Width           =   1455
  135.    End
  136.    Begin VB.Label Label3 
  137.       Caption         =   "Subject:"
  138.       Height          =   255
  139.       Left            =   240
  140.       TabIndex        =   4
  141.       Top             =   1080
  142.       Width           =   1455
  143.    End
  144.    Begin VB.Label Label2 
  145.       Caption         =   "Recipient Address:"
  146.       Height          =   255
  147.       Left            =   240
  148.       TabIndex        =   2
  149.       Top             =   600
  150.       Width           =   1575
  151.    End
  152.    Begin VB.Label Label1 
  153.       Caption         =   "This Examples SEND a ""background"" message from Your Code."
  154.       Height          =   255
  155.       Left            =   1560
  156.       TabIndex        =   1
  157.       Top             =   120
  158.       Width           =   4575
  159.    End
  160. Attribute VB_Name = "SimpleForm"
  161. Attribute VB_Creatable = False
  162. Attribute VB_Exposed = False
  163. Private Sub Command1_Click()
  164.     Dim Ret As Boolean
  165.     If MSess1.Logon = True Then
  166.         MReci1.Clear
  167.         MReci1.ResolveName = szAddress
  168.         If MReci1.ResolveName = "" Then
  169.             MsgBox "Recipient Address NOT Found"
  170.         Else
  171.             MReci1.Action = ACTION_ADDRECIPIENT
  172.             MMsg1.Action = ACTION_NEW
  173.             MMsg1.WorkingMsg = COMPOSE_MSG
  174.             MReci1.Action = ACTION_RECIP_SET
  175.             MMsg1.Subject = szSubject
  176.             MMsg1.NoteText = szNoteText
  177.             MFile1.Clear
  178.             Ret = MFile1.AddItem(szFileName.Text)
  179.             If Ret = False Then MsgBox "Error Setting File Attachment"
  180.             MFile1.Action = ACTION_FILESET
  181.             
  182.             MMsg1.Action = ACTION_SENDMSG
  183.             
  184.             If MMsg1.ErrorNum = 0 Then
  185.                 MsgBox "Message has been sent"
  186.             Else
  187.                 MsgBox "Error Sending The Mail message"
  188.             End If
  189.         End If
  190.     Else
  191.         MsgBox "No Active Session available"
  192.     End If
  193. End Sub
  194. Private Sub Command2_Click()
  195.     MSess1.Logon = True
  196. End Sub
  197.